<?php

App::uses('AppModel', 'Model');

class User extends AppModel {

    var $useTable = "users";
    var $validate = array(
        'password' => array('rule' => array('minLength', 6), 'message' => 'La contraseña debe tener al menos 6 caracteres.'),
        'email' => array('rule' => 'email', 'message' => 'Debes ingresar una cuenta de correo electr&oacute;nico valida.'),
        'rfc' => array('rule' => 'alphaNumeric', 'allowEmpty' => false, 'message' => 'RFC: Solo permite letras y numeros.'));

    public function getUserName($username) {
        $user = array(
            'conditions' => array(
                'username' => $username,
            )
        );
        return $this->find('all', $user);
        
    }

}

?>